﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tanks
{
    public class KeyboardController:Controller
    {
        Game game = Game.Instance();
        KeyboardLayout Layout;
        public override void Control()
        {
            if (game.KeyList[Layout.FireKey])
            {
                tank.Fire();
            }
            else if (game.KeyList[Layout.LeftKey])
            {
                tank.Step(Direction.West);
            }
            else if (game.KeyList[Layout.RightKey])
            {
                tank.Step(Direction.East);
            }
            else if (game.KeyList[Layout.UpKey])
            {
                tank.Step(Direction.North);
            }
            else if (game.KeyList[Layout.DownKey])
            {
                tank.Step(Direction.South);
            }
            else if (game.KeyList[Layout.WeaponKey])
            {
                tank.nextWeap();
            }

        }
        public KeyboardController(KeyboardLayout kl)
        {
            Layout = kl;
        }
    }
}
